package org.one.afternoon.quartz;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "t_report_subscribe", autoResultMap = true)
@NoArgsConstructor
public class ReportSubscribePO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @Schema(description = "主键id")
    @TableId(value = "id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    /**
     * 报告名称
     */
    @Schema(description = "报告名称")

    private String reportName;

    /**
     * 模板id
     */
    @Schema(description = "模板id")
    private String templateId;

    /**
     * 报告创建时间
     */
    @Schema(description = "创建时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间，拓展字段
     */
    @Schema(description = "更新时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * cron表达式
     */
    @Schema(description = "cron表达式")
    private String cronExpression;
    /**
     * 发送周期：day-每天,week-每周,month-每月
     */
    @Schema(description = "发送周期:day-每天,week-每周,month-每月")
    private String sendPeriod;
    /**
     * 日:月末用"end"
     */
    @Schema(description = "日:月末用:end")
    private String sendDay;
    /**
     * 时
     */
    @Schema(description = "时")
    private Integer sendHour;

    /**
     * 上一次生成时间
     */
    @Schema(description = "上一次生成时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastTime;
    /**
     * * 下一次生成时间
     */
    @Schema(description = "下一次生成时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextTime;
    /**
     * * 发送邮箱设备id
     */
    @Schema(description = "发送邮箱设备id")
    private String deviceId;


    /**
     * * 接收人邮箱
     */
    @Schema(description = "接收人邮箱")
    private String receiveEmails;
    /**
     * * 状态：true-启用，false-禁用
     */
    @Schema(description = "状态：true-启用，false-禁用")
    private Boolean status;
    /**
     * * 报告类型
     */
    @Schema(description = "报告类型")
    private String type;
    /**
     * * 报告格式
     */
    @Schema(description = "报告格式")
    private String format;
    /**
     * * 统计周期 :0-前1天,1-前1周,2-前1月
     */
    @Schema(description = "统计周期 :0-前1天,1-前1周,2-前1月")
    private Integer statisticalPeriod;

    /**
     * 订阅人
     */
    @Schema(description = "订阅人")
    private String subscribeOwner;
}

